Skip to content

replace /proxy route with something more secure#10

Merged
Ziul merged 4 commits intomainfrom
feature/proxy
May 23, 2025
Merged

replace /proxy route with something more secure#10
Ziul merged 4 commits intomainfrom
feature/proxy

Conversation

@Ziul
Copy link
Owner

@Ziul Ziul commented May 23, 2025

Description

This PR refactors the API to remove the generic /proxy route and introduces a new, more explicit /services/{name} route. The {name} parameter corresponds to a key in the services.json file, allowing for more controlled and secure access to registered OpenAPI service endpoints.

Main Changes

  • Removed the /proxy endpoint and all related logic.
  • Added a new /services/{name} endpoint that:
  • Looks up the service configuration by name in services.json.
  • Forwards requests to the configured URL, applying any custom headers.
  • Returns the OpenAPI spec as JSON or YAML, depending on the upstream content type.
  • Returns appropriate error codes for missing services or unsupported content types.
  • Updated the controller logic and tests to use the new {namespace}.{name} key format for services.
  • Refactored tests to mock requests to the new /services/{name} endpoint and removed all references to /proxy.
  • Improved error handling and logging for missing or invalid service definitions.
  • Updated the main page and configuration page to use the new service structure.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactoring

Checklist

  • Tests added/updated
  • Documentation updated (if necessary)
  • Code follows project standards

Ziul added 4 commits May 23, 2025 10:08
Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com>
Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com>
Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com>
Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com>
@Ziul Ziul merged commit 1813528 into main May 23, 2025
5 checks passed
@Ziul Ziul deleted the feature/proxy branch May 23, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant